package com.videoweb.controller;


import com.videoweb.annotation.Anonymous;
import com.videoweb.entity.Category;
import com.videoweb.entity.Tag;
import com.videoweb.entity.vo.categoryVo;
import com.videoweb.service.ITagService;
import com.videoweb.utils.AjaxResult;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.stream.Collectors;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lmr
 * @since 2025-05-17
 */


@RestController
@RequestMapping("/tag")
public class TagController {
    @Autowired
    ITagService tagService;


    @GetMapping("/{id}")
    public AjaxResult getCategoryList(@PathVariable("id") Long videoId) {

        List<Tag> tags = tagService.getTagsByVideoId(videoId);

        return AjaxResult.success(tags);

    }
}